package cn.net.gemai.springboot_mybatis.service.impl;

import cn.net.gemai.springboot_mybatis.entity.Person;
import cn.net.gemai.springboot_mybatis.mapper.PersonMapper;
import cn.net.gemai.springboot_mybatis.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class PersonServiceImpl implements PersonService {

    @Autowired
    private PersonMapper personMapper;

    @Override
    public List<Person> selectAll() {
        List<Person> list = personMapper.selectAll();
        return list;
    }

    @Override
    public Person selectById(int id) {
        Person person = personMapper.selectById(id);
        return person;
    }
}
